大数据平台-Zabbix agent恢复 发表于 2017-05-24 | 更新于 2018-05-29 | 分类于 CDH , Error zabbix agent 进程恢复 v1.1 updated:2017-05-30 Nameless13 因系统重启后,zabbix agent没有设置开机启动所以会导致监控失效ps aux |grep zabbixcd /etc/init.d/ls |grep zabbixcd /etc/init.d && wget http://10.200.58.25/zabbix/zabbix_agentd && chkconfig zabbix_agentd 2345 && service chmod +x zabbix_agentd service zabbix_agentd startchkconfig zabbix_agentd onchkconfig --listchkconfig zabbix_agentd 2345chkconfig --listps aux |grep zabbix zabbix_agentd#! /bin/sh# Copyright (c) 07/2004 A.Tophofen, Germany# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2# April 2005, A. Kiepe, Switzerland# Modified for Zabbix 2.0.0# May 2012, Zabbix SIA## init.d/zabbix_agentd#### BEGIN INIT INFO# Provides: zabbix_agentd# Required-Start: $network $remote_fs $syslog# Required-Stop:# Default-Start: 3 # Default-Stop:# Description: Starts Zabbix_Agentd### END INIT INFO. /etc/rc.statusrc_resetNAME="zabbix_agentd"ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"ZABBIX_PID="/tmp/zabbix_agentd.pid"if [ ! -x ${ZABBIX_BIN} ] ; then echo -n "${ZABBIX_BIN} not installed! " # Tell the user this has skipped rc_status -s exit 5fiexport PATH=$PATH:/usr/local/sbincase "$1" in start) echo -n "Starting ${NAME} " checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN} case $? in 0) echo -n "- Warning: ${NAME} already running! " ;; 1) echo -n "- Warning: ${ZABBIX_PID} exists! " ;; esac startproc -p ${ZABBIX_PID} ${ZABBIX_BIN} rc_status -v ;; stop) echo -n "Shutting down ${NAME}" checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN} || echo -n "- Warning: ${NAME} not running! " killproc -p ${ZABBIX_PID} -TERM ${ZABBIX_BIN} rc_status -v ;; restart) $0 stop sleep 10 $0 start rc_status ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;;esacrc_exit